import type { RouteRecordRaw } from 'vue-router';

import CommonPage from './common-page';

const commonRoutes: RouteRecordRaw[] = [
  {
    name: 'index',
    path: '/',
    redirect: CommonPage.DASHBOARD,
  },
  {
    name: 'dashboard',
    path: CommonPage.DASHBOARD,
    component: () => import('@/pages/layouts/index.vue'),
  },
  {
    name: 'login',
    path: CommonPage.LOGIN,
    component: () => import('@/pages/login/index.vue'),
    meta: {
      title: '登录',
      keepAlive: false,
      affix: false,
    },
  },
  {
    name: 'notFound',
    path: CommonPage.NOT_FOUND,
    component: () => import('@/pages/404/index.vue'),
    meta: {
      title: '404',
      keepAlive: false,
      affix: false,
    },
  },
  {
    path: '/:path(.*)*',
    redirect: {
      name: 'notFound',
    },
  },
];

export default commonRoutes;
